package com.vgemv.jsutilitysdk.Request;


import com.vgemv.jsutilitysdk.Request.JsRequestManager.JsRequestDictionaryCallback;
import com.vgemv.jsutilitysdk.Request.JsRequestManager.JsRequestStringCallback;

import java.io.IOException;
import java.util.Map;

import okhttp3.Response;

public interface JsRequestInterface {

    public static final  int ResponseStatusResponseParseError = -100;

//    public static IGajNetworkManager sharedInstane();
    //服务器地址
    public String serverAddress = null;

    //1 Get
    //1.1 异步请求
    //1.1.1 异步-字典参数-字典结果
    public void getRequest(final String interfaceUrlString, Map<String,String> map_param, final JsRequestDictionaryCallback dictionaryCallback);
    //1.1.2 异步-字典参数-字符串结果
    public void getRequest(final String interfaceUrlString, Map<String,String> map_param, final JsRequestStringCallback dictionaryCallback);
    //1.2.1 异步-字符串参数.
    public void getRequest(final String interfaceUrlString, final String requestBodyString, final JsRequestStringCallback cb);

    //1.3 同步请求
    public Response getRequestSync(final String interfaceUrlString, final Map<String,String> requestParamMap)  throws IOException;
    //字典作为输入和输出的参数,是满足大部分需求的.

    //post请求的四种传值方式:
    //1,application/json
    //2,x-www-form-urlencoded,表单模式
    //3,form-data,表单模式?
    //4,raw

    //2 Post
    //2.1.1 post application/json
    //异步请求
    public void postReqeustByJson(final String interfaceUrlString, Map map_param, final JsRequestDictionaryCallback cb);
    //同步请求
    //2.1.2
    public Response postRequestSyncByJson(final String interfaceUrlString, String requestParam) throws IOException;


}

